package com.dong.c11_netty_heartbeat;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.channel.SimpleUserEventChannelHandler;
import io.netty.handler.timeout.IdleStateEvent;

/**
 * <h1></h1>
 *
 * @author : dzj
 * @create: 2021-03-09 15:56
 */
public class HeartBeatServerHandler extends ChannelInboundHandlerAdapter {
    @Override
    public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
        if(evt instanceof  IdleStateEvent) {
            IdleStateEvent event = (IdleStateEvent) evt;
            System.out.println("获得事件 : "+event.state().name());
        }

    }

}
